/* 
 * File:   Image.h
 * Author: ungerma
 *
 * Created on 15. August 2014, 16:15
 */

#ifndef IMAGE_H
#define	IMAGE_H

#include <cstdlib>

#include "opencv2/opencv.hpp"

using namespace cv;
using namespace std;

class SingleImage;

class ImageWindow {
public:

    ImageWindow(Rect rectangle, int pyramidLevel = 0);
    SingleImage* getParent();
    void setParent(SingleImage* parent);
    Rect getRectangle();
    void setRectangle(Rect rectangle);
    int getPyramidLevel();
    void setPyramidLevel(int level);
    Mat getData();
    string getIDString();

protected:

    Rect rectangle;
    int pyramidLevel;
    SingleImage* parent;
    
};

class SingleImage {
public:
    
    SingleImage();
    SingleImage(Mat data, string filename, float groundTruth, 
            vector<ImageWindow> windows, float y=0);
    
    Mat getData();
    void setData(Mat data);
    string getFilename();
    void setFilename(string filename);
    float getGroundTruth();
    void setGroundTruth(float groundTruth);
    vector<ImageWindow>* getWindows();
    void addWindow(ImageWindow iw);
    void setWindows(vector<ImageWindow> windows);
    float getY();
    void setY(float y);
    bool hasWindows();
    void releaseMatrix();
    string getIDString();
    
protected:

    Mat data;
    string filename;
    float groundTruth;
    float y;
    vector<ImageWindow> windows;
    
};

#endif	/* IMAGE_H */
